package cc.lucien.service;

import cc.lucien.entity.Role;
import cc.lucien.repository.RoleRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleService {

    @Autowired
    private RoleRepository roleRepository;

    public List<Role> findAll() {
        return roleRepository.findAll();
    }

    public Role findById(Integer id) {
        return roleRepository.findById(id);
    }

    public int save(Role role) {
        return roleRepository.save(role);
    }

    public int update(Role role) {
        return roleRepository.update(role);
    }

    public int deleteById(Integer id) {
        return roleRepository.deleteById(id);
    }
}
